feat: Add debug mode to one-shot commands#631
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #631 +/- ##
==========================================
- Coverage 77.95% 77.84% -0.11%
==========================================
Files 39 39
Lines 4635 4654 +19
Branches 754 759 +5
==========================================
+ Hits 3613 3623 +10
- Misses 716 724 +8
- Partials 306 307 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Benchmark ResultsBenchmarks use a no-op Tesseract to measure pure framework overhead. 🚀 0 faster, ✅ No significant performance changes detected. Full results
|
| return "\n".join(docstring) | ||
|
|
||
|
|
||
| def _maybe_start_debugger(wait_for_client: bool, port: int = 5678) -> None: |
There was a problem hiding this comment.
I think the logic here would turn out cleaner if this was just _start_debugger (or more accurately _start_debug_server), and you check for config.debug in the caller.
There was a problem hiding this comment.
I wonder if there's a good way to test this on the runtime side, too. Maybe run in debug mode with a trivial Tesseract and ensure it only exits after a fake debugger is attached?
dionhaefner
left a comment
There was a problem hiding this comment.
Great feature and implementation, thanks!
Relevant issue or PR
Debugging Tesseracts was limited to the
servecommand; this extends it totesseract run ...commands. For those, the runtime waits for a debugger to attach, so that everything after it is in principle observable. That includes, for instance,tesseract_api.pyimport-time stuff.Description of changes
servedebugger into a common function.--debugarg torun; piped that in a few placesSome questions still open:
-Xfrozen_modules=off)."port": "${input:debugPort}"in the launch config, and a corresponding input defined).Testing done
(warnings were still there because this video is before cea6bd3)
Recording.2026-06-26.181450.mp4
Here's a more refined version, with the edits described in the previous section
Recording.2026-06-26.225216.mp4